]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
layout: Remove redundant background refresh
authorJonas Ådahl <jadahl@gmail.com>
Thu, 9 Jul 2020 07:18:27 +0000 (09:18 +0200)
committerRobert Mader <robert.mader@posteo.de>
Tue, 14 Jul 2020 23:14:39 +0000 (23:14 +0000)
When using the NVIDIA driver, textures tend to loose their pixels when
suspending. In the past we handled this by figuring out when the NVIDIA
driver was used, and reload the background whenever we noticed we
resumed from suspend.

This shouldn't be needed anymore after
https://gitlab.gnome.org/GNOME/mutter/merge_requests/600, as it should
handle this by listening to video-memory-purged signal. Thus remove our
special handling here.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1358

js/ui/layout.js
src/shell-util.c
src/shell-util.h

index 4cd0665824f8cab49f9aaa938cc294a72aba6ba8..55cefb2823f02396b79d1e1e7340be892ab2cabd 100644 (file)
@@ -6,7 +6,6 @@ const Signals = imports.signals;
 
 const Background = imports.ui.background;
 const BackgroundMenu = imports.ui.backgroundMenu;
-const LoginManager = imports.misc.loginManager;
 
 const DND = imports.ui.dnd;
 const Main = imports.ui.main;
@@ -295,18 +294,6 @@ var LayoutManager = GObject.registerClass({
         monitorManager.connect('monitors-changed',
                                this._monitorsChanged.bind(this));
         this._monitorsChanged();
-
-        // NVIDIA drivers don't preserve FBO contents across
-        // suspend/resume, see
-        // https://bugzilla.gnome.org/show_bug.cgi?id=739178
-        if (Shell.util_need_background_refresh()) {
-            LoginManager.getLoginManager().connect('prepare-for-sleep',
-                (lm, suspending) => {
-                    if (suspending)
-                        return;
-                    Meta.Background.refresh_all();
-                });
-        }
     }
 
     // This is called by Main after everything else is constructed
index dd9be51a3d81a5b64b1c3b8ba591541979571b63..5fe2dfcaf56ec4e0b9905f0663fcc2a26152fc22 100644 (file)
@@ -409,34 +409,6 @@ shell_util_create_pixbuf_from_data (const guchar      *data,
 
 typedef const gchar *(*ShellGLGetString) (GLenum);
 
-static const gchar *
-get_gl_vendor (void)
-{
-  static const gchar *vendor = NULL;
-
-  if (!vendor)
-    {
-      ShellGLGetString gl_get_string;
-      gl_get_string = (ShellGLGetString) cogl_get_proc_address ("glGetString");
-      if (gl_get_string)
-        vendor = gl_get_string (GL_VENDOR);
-    }
-
-  return vendor;
-}
-
-gboolean
-shell_util_need_background_refresh (void)
-{
-  if (!clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
-    return FALSE;
-
-  if (g_strcmp0 (get_gl_vendor (), "NVIDIA Corporation") == 0)
-    return TRUE;
-
-  return FALSE;
-}
-
 static gboolean
 canvas_draw_cb (ClutterContent *content,
                 cairo_t        *cr,
index aa79f49736283badd168374949eddfe8ca7cc0a2..00127ca957f0be2f874cb1a8c515b950018aee8f 100644 (file)
@@ -49,8 +49,6 @@ GdkPixbuf *shell_util_create_pixbuf_from_data (const guchar      *data,
                                                int                height,
                                                int                rowstride);
 
-gboolean shell_util_need_background_refresh (void);
-
 ClutterContent * shell_util_get_content_for_window_actor (MetaWindowActor *window_actor,
                                                           MetaRectangle   *window_rect);